package lyn1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lyn
 * Date: 2025-01-18
 * Time: 11:34
 */
class Shape{
    public void draw(){
        System.out.println("画图形！！！");
    }
}
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("◆");
    }
}
class Cycle extends Shape{
    @Override
    public void draw() {
        System.out.println("●");
    }
}
class Flower extends Shape{
    @Override
    public void draw() {
        System.out.println("❀");
    }
}
public class text {

    public static void drawMap(Shape shape){
        shape.draw();
    }

    public static void main(String[] args) {
        Cycle cycle = new Cycle();
        Rect rect = new Rect();
        Flower flower = new Flower();

       /* drawMap(cycle);
        drawMap(rect);
        drawMap(flower);*/
        Shape[] shapes = {cycle,rect,cycle,rect,flower};
        for (Shape shape : shapes){
            shape.draw();
        }
    }
}

